#ifndef _TG_Data_H_Define__
#define _TG_Data_H_Define__

#include "TG_TYPE.h"
#include "stdio.h"
#include "string.h"

enum _eTG_FRAME_TYPE
{
	TG_FRAME_TYPE_A        = 0x10,  //audio
	TG_FRAME_TYPE_A_ADPCM  = 0x11,
	TG_FRAME_TYPE_A_MP3    = 0x12,
	TG_FRAME_TYPE_A_AAC    = 0x13,
	TG_FRAME_TYPE_V        = 0x20,  //video
	TG_FRAME_TYPE_V_I      = 0x21,  //main
	TG_FRAME_TYPE_V_P      = 0x22,
	TG_FRAME_TYPE_V_B      = 0x23,
	TG_FRAME_TYPE_V2       = 0x24,  //sub
	TG_FRAME_TYPE_V2_I     = 0x25,  
	TG_FRAME_TYPE_V2_P     = 0x26,
	TG_FRAME_TYPE_V2_B     = 0x27,
	TG_FRAME_TYPE_V3       = 0x28,  //three
	TG_FRAME_TYPE_V3_I     = 0x29,  
	TG_FRAME_TYPE_V3_P     = 0x2A,
	TG_FRAME_TYPE_V3_B     = 0x2B,
	TG_FRAME_TYPE_P        = 0x30,  //pic
	TG_FRAME_TYPE_P_MJPEG  = 0x31,
	TG_FRAME_TYPE_VA       = 0x40,  //video analy
	TG_FRAME_TYPE_MF       = 0x50,  //video move flag
};

/*
//����cFrameType==TG_FRAME_TYPE_V_I
//    cFrameType==TG_FRAME_TYPE_VA
//    cFrameType==TG_FRAME_TYPE_MF
//�ŶԺ������NAL����
*/
enum _eTG_NAL_TYPE
{
	TG_NAL_UNKNOWN       = 0,
	TG_NAL_SLICE_SPS    = 0xA1,
	TG_NAL_SLICE_PPS    = 0xA2,
	TG_NAL_SLICE_IDR    = 0xA3,
	TG_NAL_MV_CFG       = 0x51,
	TG_NAL_VL_AL_CFG    = 0x52,
	TG_NAL_VL_CNT_CFG   = 0x53,
	TG_NAL_MV_RET       = 0x61,
	TG_NAL_VL_AL_RET    = 0x62,
	TG_NAL_VL_CNT_RET   = 0x63,
};


//����Ƶ���֡ͷ
#pragma pack(push,4)
typedef struct _tagTG_FRAME_HEAD 
{
	UINT8   cFrameType;   //_eTG_FRAME_TYPE
	UINT8   cHeadSize;
	UINT16  nFrameNum;    //
	UINT32  nFrameSize;
	UINT32  nTimeStamp;

	_tagTG_FRAME_HEAD()
	{
		memset(this,0,sizeof(_tagTG_FRAME_HEAD));
		cHeadSize = sizeof(_tagTG_FRAME_HEAD);
	}

}TG_FRAME_HEAD;
#pragma pack(pop)


//========================================================
//ÿ֡��ݿ��ܰ�0������NAL�����cFrameType����
//DATA(a/v) = (TG_NAL_HEAD+NAL)+.....
//========================================================

//NAL���ͷ
#pragma pack(push,4)
typedef struct _tagTG_NAL_HEAD 
{
	unsigned long cNalType:8;     //eTG_NAL_TYPE
	unsigned long lNalSize:24;

}TG_NAL_HEAD;
#pragma pack(pop)


#endif
